package com.blockmeta.bbs.businesslibrary.util;

import android.content.Context;

import com.blockmeta.bbs.businesslibrary.arouter.RouterHelper;
import com.blockmeta.bbs.businesslibrary.arouter.RouterPath;
import com.blockmeta.bbs.businesslibrary.constant.Constant;
import com.blockmeta.bbs.businesslibrary.constant.NetConstant;
import com.hellobike.flutter.thrio.navigator.ThrioNavigator;

import java.util.HashMap;
import java.util.Map;

public class RouterActivityHelper {

    public static void openUserCenter(Context mContext, String userId) {
        Map<String, Integer> map = new HashMap<>();
        map.put("userId", Integer.parseInt(userId));

        ThrioNavigator.push("/user/main",
                map,
                false,
                (view) -> {
                    return null;
                }
        );

//        RouterHelper.buildPath(RouterPath.PERSONHOME)
//                .withString(Constant.ZERO, userId)
//                .navigation(mContext);

//        RouterHelper.buildPath(RouterPath.HTML_USER_CENTER_ACTIVITY)
//                .withString(Constant.ZERO, NetConstant.PERSONAL_HOME + userId)
//                .withString(Constant.ONE, "个人资料-趣会论坛")
//                .navigation(mContext);
    }

    public static void openPeronalHomePage(Context mContext, String userId) {

        Map<String, Integer> map = new HashMap<>();
        map.put("userId", Integer.parseInt(userId));

        ThrioNavigator.push("/user/main",
                map,
                false,
                (view) -> {
                    return null;
                }
        );
//        RouterHelper.buildPath(RouterPath.PERSONHOMEPAGE_ACTIVITY)
//                .withString(Constant.ZERO, userId)
//                .navigation(mContext);

//        RouterHelper.buildPath(RouterPath.HTML_USER_CENTER_ACTIVITY)
//                .withString(Constant.ZERO, NetConstant.PERSONAL_HOME + userId)
//                .withString(Constant.ONE, "个人资料-趣会论坛")
//                .navigation(mContext);
    }

    public static void openNewWeb(Context mContext, String url) {
        openNewWeb(mContext, url, false);
    }

    public static void openNewWeb(Context mContext, String url, boolean hideTitle) {
        RouterHelper.buildPath(RouterPath.CHAINTHING_ACTIVITY)
                .withString(Constant.ZERO, url)
                .withBoolean(Constant.ONE, hideTitle)
                .navigation(mContext);
    }
}
